package com.yhq.ojbackendjudgeservice.controller.inner;

import com.yhq.ojbackendjudgeservice.judge.JudgeService;
import com.yhq.ojbackendserviceclient.service.JudgeFeignClient;
import com.yhq.ojbackendmodel.model.entity.QuestionSubmit;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: oj-backend-microservice
 * @description: 判题控制器（该服务仅供内部调用）
 * @author: HenryYang
 * @create: 2023-09-03 16:13
 **/
@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeignClient {
    @Resource
    private JudgeService judgeService;
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId){
        return judgeService.doJudge(questionSubmitId);
    }

}